import service from '@/server/index.js'

// 分页查询公告表
export const getPage = (params = {}) => {
  return service({
    url: "/notice/page",
    method: "GET",
    params: params,
    setting: {
      isToken: true
    }
  });
};

// 查询公告表列表
export const getList = () => {
  return service({
    url: "/notice/list",
    method: "GET",
    setting: {
      isToken: true
    }
  });
};

// 新增公告表
export const add = (params = {}) => {
  return service({
    url: "/notice",
    method: "POST",
    data: params,
    setting: {
      isToken: true
    }
  });
};

// 修改公告表
export const update = (params = {}) => {
  return service({
    url: "/notice",
    method: "PUT",
    data: params,
    setting: {
      isToken: true
    }
  });
};

// 删除公告表
export const del = (id) => {
  return service({
    url: "/notice/" + id,
    method: "DELETE",
    setting: {
      isToken: true
    }
  });
};

// 根据ID查询公告表
export const getById = (id) => {
  return service({
    url: "/notice/" + id,
    method: "GET",
    setting: {
      isToken: true
    }
  });
};
